package com.bzkj.web.controller.yxl;

import com.bzkj.basicinfo.domain.wms.StoStockEntity;
import com.bzkj.basicinfo.service.yxl.YxlStoStockService;
import com.bzkj.common.annotation.LogC;
import com.bzkj.common.core.controller.BaseController;
import com.bzkj.common.core.domain.AjaxResult;
import com.bzkj.common.core.page.TableDataInfo;
import com.bzkj.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author：swj
 * @Desc
 * @Date：2025/7/28 14:55
 */
@Api(tags = "库存管理")
@RestController
@RequestMapping("/yxl/stock")
public class YxlStoStockController extends BaseController {
    @Autowired
    private YxlStoStockService yxlStoStockService;

    @ApiOperation("查询接口")
//    @PreAuthorize("@ss.hasPermi('basic:nccBasic:query')")
    @GetMapping("/queryBasicInfo")
    public TableDataInfo queryBasicInfo(StoStockEntity entity) {
        startPage();
        return getDataTable(yxlStoStockService.queryBasicInfo(entity));
    }

    @ApiOperation("查询接口")
//    @PreAuthorize("@ss.hasPermi('basic:nccBasic:query')")
    @GetMapping("/queryStoStockInfo")
    public TableDataInfo queryStoStockInfo(StoStockEntity entity) {
        startPage();
        return getDataTable(yxlStoStockService.queryStoStockInfo(entity));
    }
    @ApiOperation("导出接口")
    @LogC(title = "导出库存盘点", businessType = BusinessType.EXPORT)
    @PostMapping("/exportStoStockInfo")
    public AjaxResult exportStoStockInfo( StoStockEntity entity, HttpServletResponse response) {
        return yxlStoStockService.exportStoStockInfo(entity,response);
    }

    @ApiOperation("查询接口")
//    @PreAuthorize("@ss.hasPermi('basic:nccBasic:query')")
    @GetMapping("/queryStoStockLog")
    public AjaxResult queryStoStockLog(String operator,String operateType,String batchCode,String productName,
                                       String manufacturer,String beginDate,String endDate,Integer pageNum,Integer pageSize) {
        return yxlStoStockService.queryWmsStockLog(operator, operateType, batchCode, productName, manufacturer,
                beginDate, endDate,pageNum,pageSize);
    }
}
